<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>layui</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <link rel="stylesheet" href="__PUBLIC__/layui/css/layui.css"  media="all">
  <link rel="stylesheet" href="__PUBLIC__/font-awesome/css/font-awesome.min.css" media="all" />
  <link rel="stylesheet" href="__CSS__/admin.css"  media="all">
</head>
<style>
    .layui-form-label {
	    width: 140px;
	}
</style>
<body style="padding:10px;">
  <div class="tplay-body-div">
    <div class="layui-tab">
      <ul class="layui-tab-title">
        <li><a href="{:url('admin/dinner/biaoqian')}" class="a_menu">标签管理</a></li>
        <li class="layui-this"><a href="#">编辑标签</a></li>
      </ul>
    </div> 
    <div style="margin-top: 20px;">
    </div>
    <form class="layui-form" id="admin">
			<input type="hidden" name="id" value="{$bq.id}" />
      <div class="layui-form-item">
        <label class="layui-form-label">标签名字</label>
        <div class="layui-input-inline">
          <input name="name" lay-verify="required" value="{$bq.name}" autocomplete="off" placeholder="请输入标签名字" class="layui-input" type="text" >
        </div>
      </div>
      
      <div class="layui-form-item">
        <label class="layui-form-label">排序</label>
        <div class="layui-input-inline">
          <input name="sort" lay-verify="required" autocomplete="off" value="{$bq.sort}" class="layui-input" type="text">
        </div>
      </div>
      
      <div class="layui-form-item">
        <div class="layui-input-block">
          <button class="layui-btn" lay-submit lay-filter="admin">立即提交</button>
          <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
      </div>
      
    </form>


    <script src="__PUBLIC__/layui/layui.js"></script>
    <script src="__PUBLIC__/jquery/jquery.min.js"></script>
  
    <script>
        var message;
        layui.config({
            base: '__JS__/',
            version: '1.0.1'
        }).use(['app', 'message'], function() {
            var app = layui.app,
                $ = layui.jquery,
                layer = layui.layer;
            //将message设置为全局以便子页面调用
            message = layui.message;
            //主入口
            app.set({
                type: 'iframe'
            }).init();
        });
        
        
      layui.use(['layer', 'form'], function() {
          var layer = layui.layer,
              $ = layui.jquery,
              form = layui.form;
          $(window).on('load', function() {
              form.on('submit(admin)', function(data) {
                  $.ajax({
                      url:"{:url('admin/dinner/edit_biaoqian')}",
                      data:$('#admin').serialize(),
                      type:'post',
                      async: false,
                      success:function(res) {
                      		layer.msg(res.msg);
                          if(res.code == 200) {
                              $("#admin").reset();
                          } 
                      }
                  })
                  return false;
              });
          });
      });
      
      var index = '';
      function overShow(){  
      //配置一个透明的询问框
	      index = layer.msg('温馨提示<br>您输入的数值越大，优惠越大<br>例：商品原价￥100.00<br>优惠比例输入20%<br>则实际收款为￥80.00元<br> 算法：￥100.00-(100.00*20%)=￥80.00', {
	        time:  '', //20s后自动关闭
	        btnAlign: 'c'//按钮居中 
	      }); 
      }
      
      function outHide(){
      	layer.close(index);
      }
    </script>
  </div>
</body>
</html>